/*
 * utils.cpp
 *
 *  Created on: Feb 18, 2012
 *      Author: nhatuan
 */

#include "utils.h"

vector<string> split(string source, char delim) {
	vector<string> retVec;
	int length = source.size();
	string tmpString = "";
	for (int i=0; i<length; i++) {
		if(source[i] == delim) {
			retVec.push_back(tmpString);
			tmpString = "";
		}
		else {
			tmpString += source[i];
		}
	}
	if(tmpString != "")
		retVec.push_back(tmpString);

	return retVec;
}

vector<string> getHeader(string source) {
	vector<string> header = split(source, '\t');
	for(int i=0; i<9; i++) {
		header.erase(header.begin() + 0);
	}
	return header;
}
